StupidBeauty
Read times:1049Posted at:Sun Jan 5 19:49:22 2014
- no title specified

安卓开发中,从SD卡上图片载入的Bitmap对象默认是只读的,如果妳对它做setPixels操作就会引发异常。解决方法是,使用 Bitmap.copy(Bitmap.Config config, boolean isMutable)从原来的 Bitmap对象里复制出一个可写的Bitmap.

http://stackoverflow.com/questions/6764839/error-with-setpixels

亮点

15 down vote accepted

I think your Bitmap is not mutable (see setPixel()'s documentation).

If so, create a mutable copy of this Bitmap (using Bitmap.copy(Bitmap.Config config, boolean isMutable) as an example) and work on this one.

share|improve this answer

answered Jul 20 '11 at 16:05

Shlublu
4,96421635

未知美人

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands